package com.fansl.allround.common.security.service;

import com.fansl.allround.common.core.constant.enums.OauthTypeEnum;
import com.fansl.allround.common.core.bean.UserInfo;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/25 15:06
 */
public interface AllroundUserDetailsService extends UserDetailsService {
    /**
     * 根据用户名获取用户信息
     * @param username
     * @return
     * @throws UsernameNotFoundException
     */
    @Override
    UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;

    /**
     * 根据认证类型获取用户信息
     * @param oauthName 认证内容
     * @param oauthType 认证类型
     * @return
     * @throws UsernameNotFoundException
     */
    UserDetails loadUserByOauthType(String oauthName,OauthTypeEnum oauthType) throws UsernameNotFoundException;

    /**
     * 注册用户
     * @param userInfo
     * @return
     */
    UserDetails getUserDetails(UserInfo userInfo);
}
